<?php
    require("../../mecms/lib/uploadImage.php");
    // 上传图片
    $file = $_GET['file'];
    $upload = new Upload($file);
    $uploadArr = $upload->uploads();

    $json = array();
    if($uploadArr["flag"]){
        $json["uploaded"] = 1;
        $json["url"] = $uploadArr["path"];
    }else{
        $json["uploaded"] = 0;
        $json["msg"] = $uploadArr["msg"];
    }
    
    echo json_encode($json, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK);
?>